#include "uf1.h"

QuickFind::QuickFind(int n):UFBase(n)
{

}

int QuickFind::find(int sites)
{
    return id[sites];
}

void QuickFind::unionSites(int s1, int s2)
{
    if(id[s1] == id[s2])
        return;
    else{

        for (int i = 0; i < id.size(); ++i)
        {
            if(id[i] == id[s2])
                id[i] = id[s1];
        }
        --count;

    }


}
